<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
    <title>使用slot插槽</title>
    <script src="../assets/js/vue.js"></script>
</head>
<body>
    <h1>使用slot插槽在模版中预留值对应的变量,在组件中使用slot给变量赋值</h1>
    <hr/>
    <div id="app">
        <superbone>
            <span slot='url'>{{bolgData.url}}</span>
            <span slot='name'>{{bolgData.name}}</span>
            <span slot='skill'>{{bolgData.skill}}</span>
        </superbone>
    </div>

    <template id='tep'>
        <div>
            <p>博客地址:<slot name="url"></slot></p>
            <p>网名:<slot name="name"></slot></p>
            <p>技能:<slot name="skill"></slot></p>
        </div>
    </template>

    <script>
        var app = new Vue({
            el: '#app',
            data: {
                bolgData: {
                    url: 'www.superbone.site',
                    name: '苏坡本',
                    skill: 'java'
                }
            },
            components:{
                'superbone': {
                    template: '#tep'
                }
            }
        });
    </script>

</body>
</html>